# frozen_string_literal: true

class CreateTypeMethods < ActiveRecord::Migration[6.0]
  def change
    create_table :type_methods do |t|
      t.integer :variable_type_id,  null: false,  limit: 8
      t.string  :name,              null: false,  limit: 64
      t.string  :parameters,        null: false,  limit: 255
      t.string  :description,       null: false,  limit: 255, default: ''
      t.timestamps                  null: false
    end

    add_index :type_methods, %i[name variable_type_id], unique: true
    add_foreign_key :type_methods, :variable_types
  end
end
